<%@page import="java.sql.*" %>
<%@ page import="com.hline.kbcss.MyDriver"%>
<%
String uname=request.getParameter("uname");
String password=request.getParameter("pwd");


String userId = request.getParameter("id");
String status = request.getParameter("status");

if(userId!=null && status!=null)
{
PreparedStatement pst1=null;
PreparedStatement pst2=null;
PreparedStatement pst3=null;
PreparedStatement pst4=null;


  //to remove user basic details(profile info).....   pst1
  
try{ if(Integer.parseInt(userId)<1000)
      {  
	    pst1=MyDriver.getPrepare("delete from user where userid="+userId);
		
	  }
     else	if(Integer.parseInt(userId)<10000)
	  {
		pst1=MyDriver.getPrepare("delete from faculty where userid="+userId);
	  }
	 else 
	 {
	   pst1=MyDriver.getPrepare("delete from hr where userid="+userId);
	 }
	 
	 /******to delete the user posts and his/her comments completly.......  pst2 3 4*****/
	 
	pst2=MyDriver.getPrepare("delete from articles where userid="+userId);
	pst3=MyDriver.getPrepare("delete from comments where uid="+userId);
	pst4=MyDriver.getPrepare("delete from postrmp where userid="+userId);
	pst1.executeUpdate();
	pst2.executeUpdate();
	pst3.executeUpdate();
	pst4.executeUpdate();
	
}catch(Exception e){}
}
	    response.sendRedirect(request.getParameter("rpage"));
%>